package com.example.idachuappone.wxapi;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.example.idachuappone.R;
import com.example.idachuappone.cook.item.PayPromptlyActivity;
import com.example.idachuappone.index.weixinpay.Constants;
import com.example.idachuappone.person.member.MemberDetailActivity;
import com.example.idachuappone.utils.ComUtil;
import com.tencent.mm.sdk.modelbase.BaseReq;
import com.tencent.mm.sdk.modelbase.BaseResp;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
	private IWXAPI api;
	private Dialog mCusProDialog;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_movehouse_payorder_succ);
		this.mCusProDialog = ComUtil.createCusProgressSmallBlackBgDialog(this);
		this.api = WXAPIFactory.createWXAPI(this, Constants.APP_ID);
		this.api.handleIntent(getIntent(), this);
	}

	@Override
	protected void onNewIntent(Intent intent) {
		super.onNewIntent(intent);
		setIntent(intent);
		this.api.handleIntent(intent, this);
	}

	public void onReq(BaseReq req) {
	}

	public void onResp(BaseResp resp) {
		Log.e("aaa", new StringBuilder(String.valueOf(resp.errCode)).toString());
		PayPromptlyActivity.code = resp.errCode;
		MemberDetailActivity.code = resp.errCode;
		finish();
	}
}